#include "settlement.h"
#include "ui_settlement.h"
#include "mainwindow.h"
#include "commain.h"
#include "comadmin.h"
#include "comsettlement.h"
#include "comranking.h"
#include "ranking.h"
#include <QDebug>
#include <QMovie>

Settlement::Settlement(QWidget *parent) :
    QDialog(parent),
    ui(new Ui::Settlement)
{
    ui->setupUi(this);
    //设置游戏界面的背景图
    this->setFixedSize(600,450);//固定窗口大小
    QPalette pal =this->palette();
    QImage ImgAllbackground(":/images/background3.jpg");
    QImage fitimpic = ImgAllbackground.scaled(this->width(),this->height(),Qt::IgnoreAspectRatio);
    pal.setBrush(QPalette::Window,QBrush(fitimpic));
    setPalette(pal);

    //接收登录信息
    connect(comMain::p_mainWindow,SIGNAL(comToSettlement(int))
            ,this,SLOT(doProcessMainWindowRequest(int)));
}

Settlement::~Settlement()
{
    delete ui;
}

//接收得分信息函数
void Settlement::doProcessMainWindowRequest(int score){
    qDebug() << "hello world";
    ui->label_score->setText(QString::number(score));
}

void Settlement::on_close_game_clicked()
{
    close();
}

void Settlement::on_back_game_clicked()
{
    comMain::p_mainWindow->init();
    comMain::p_mainWindow->show();
    close();
}

void Settlement::on_game_rank_clicked()
{
    comRanking::p_randking->Init();
    comRanking::p_randking->show();
    close();
}
